// import { ElLoadingComponent } from "element-ui/types/loading";
import { request } from "./core";
import METHOD from "./methods";
import URL from "./url"
// 模块接口文件 暴露给外部模块使用

const APIClient = {
    // 将对象注入vue全局
    install(Vue) {
        Vue.prototype.$API = this;
    },
    // 登录
    logint(mobile, password) { return request(METHOD.POST, URL.LOGIN, { mobile: mobile, pwd: password }) },


    register(mobile, password, code, nikcname) { return request(METHOD.POST, URL.REGISTER, { mobile: mobile, pwd: password, code: code, nikcname: nikcname }) },

    // 砍价
    kanjia() {
        return request(METHOD.GET, URL.DARG)
    },
    essay() {
        return request(METHOD.GET, URL.ESSAY)
    },
    // 商品部份
    moods() {
        return request(METHOD.GET, URL.MOODS)
    },
    // 商品分类
    fen(){
        return request(METHOD.POST,URL.FEN)
    }
}

export default APIClient